package android

// Result
// Code means
// 0成功 1失败
type Result struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

func ResultSuccessWithoutData() Result {
	return Result{
		Code: 0,
		Msg:  "",
		Data: nil,
	}
}

func ResultSuccessWithData(data interface{}) Result {
	return Result{
		Code: 0,
		Msg:  "",
		Data: data,
	}
}
func ResultFail(msg string) Result {
	return Result{
		Code: 1,
		Msg:  msg,
		Data: nil,
	}
}
